exports.send = (socket, data, core) => {
  let logger = core.getLogger('0x6e');
  let publisher = core.getService('redis').getClient();
  logger.info(data);
  const userIdBuf = core.createIntBuffer(1, 2);
  const cmdIndexBuf = core.createIntBuffer(2, 2);
  const chargingPort = core.createIntBuffer(parseInt(data.port), 1);
  let codeBuf, minutesBuf = core.createIntBuffer(0, 2);
  if (data.op == 'cancel') {
    codeBuf = core.createIntBuffer(0xAA, 1);
  }  else {
    codeBuf = core.createIntBuffer(0x55, 1);
    minutesBuf.writeUInt16LE(parseInt(`0${data.minutes}`) );
  }
  socket.once(`0x33-${userIdBuf.toString('hex')}-${cmdIndexBuf.toString('hex')}`, (info) => {
    publisher.publish('commandback', JSON.stringify({
      result: { data: info },
      callback: data.callback,
    }));
  });
  logger.info(core.concat([
    userIdBuf,
    cmdIndexBuf,
    chargingPort,
    codeBuf,
    minutesBuf
  ]));
  socket.sendCommands(0x6e, core.concat([
    userIdBuf,
    cmdIndexBuf,
    chargingPort,
    codeBuf,
    minutesBuf
  ]));
}
